package com.xinqi.modules.mq.rongyun.mq;

import com.xinqi.common.core.enums.RocketMqEnum;
import com.xinqi.common.core.utils.SpringUtils;
import com.xinqi.common.rocketmq.dto.RocketMqBean;
import com.xinqi.modules.mq.rongyun.mq.consumer.RongyunOperationConsumer;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @version V1.0
 * @Title:融云--操作类MQ消息监听
 * @Description:
 * @Copyright 星齐科技（云南）有限公司 - Powered By 技术部
 * @author: yyzhen
 * @date: 2023/7/25 11:10
 */
@Slf4j
@Component
@RequiredArgsConstructor
public class RongyunOperationRunner implements CommandLineRunner {

    private final RocketMqBean rocketMqBean = SpringUtils.getBean(RocketMqBean.class);

    private final RongyunOperationConsumer operationConsumer;

    @Override
    public void run(String... args) throws Exception {
        // 启动融云--操作类 MQ消息监听
        operationConsumer.pushOperationConsumerMsg(rocketMqBean, RocketMqEnum.RONGYUN_OPERATION);
    }

}
